﻿// JavaScript Document
ssharing_data = {
    hotCity: [
        { E: "BeiJing", C: "北京", S: "BJ" },
        { E: "ShenZhen", C: "深圳", S: "SZ" },
        { E: "GuangZhou", C: "广州", S: "GZ" },
        { E: "ShangHai", C: "上海", S: "SH" },
        { E: "WuHan", C: "武汉", S: "WH" },
        { E: "NanJing", C: "南京", S: "NJ" },
        { E: "ChengDu", C: "成都", S: "CD" },
        { E: "HangZhou", C: "杭州", S: "HZ" },
        { E: "ChongQing", C: "重庆", S: "CQ" },
        { E: "QingDao", C: "青岛", S: "QD" },
		{ E: "XiaMen", C: "厦门", S: "XM" },
		{ E: "DaLian", C: "大连", S: "DL" }
    ],
    citys: [
        { E: "BeiJing", C: "北京", S: "BJ" },
        { E: "ShenZhen", C: "深圳", S: "SZ" },
        { E: "GuangZhou", C: "广州", S: "GZ" },
        { E: "ShangHai", C: "上海", S: "SH" },
        { E: "WuHan", C: "武汉", S: "WH" },
        { E: "NanJing", C: "南京", S: "NJ" },
        { E: "ChengDu", C: "成都", S: "CD" },
        { E: "HangZhou", C: "杭州", S: "HZ" },
        { E: "ChongQing", C: "重庆", S: "CQ" },
        { E: "QingDao", C: "青岛", S: "QD" },
		{ E: "XiaMen", C: "厦门", S: "XM" },
		{ E: "DaLian", C: "大连", S: "DL" }
    ],
    folksdata: [
		{ E: "XiaMen", C: "厦门", S: "XM" },
		{ E: "DaLian", C: "大连", S: "DL" }
    ],
    HotelName: [],
    getCityCodeByName: function (cname) {
        for (var i = 0, len = this.citys.length; i < len; i++) {
            var city = this.citys[i];
            if (city.C == cname) return city.S;
        }

        YAHOO.log("get city code failure:" + cname, "warn");
        return "";
    },
    getCityNameByCode: function (code) {
        for (var i = 0, len = this.citys.length; i < len; i++) {
            var city = this.citys[i];
            if (city.S == code) return city.C;
        }

        YAHOO.log("get city name failure:" + code, "warn");
        return "";
    },
    getHotelIdByHotelName: function (Hname) {
        for (var i = 0, len = this.HotelName.length; i < len; i++) {
            var HotelName = this.HotelName[i];
            if (HotelName.C == Hname) return HotelName.HotelId;
        }

        YAHOO.log("get HotelId failure:" + Hname, "warn");
        return "";
    },
    getHotelRoomNumByHotelName: function (Hname) {
        for (var i = 0, len = this.HotelName.length; i < len; i++) {
            var HotelName = this.HotelName[i];
            if (HotelName.C == Hname) return HotelName.RoomNumber;
        }

        YAHOO.log("get HotelId failure:" + Hname, "warn");
        return "";
    }
};